package com.hgw.Demo03_DecoratorPattern.examples;

/**
 * Data time:2021/12/14 18:40
 * StudentID:2019112118
 * Author:hgw
 * Description: 构建装饰类，充当抽象装饰类
 */
public class ComponentDecorator extends Component{

    private Component component;        // 维持对抽象构建类型对象的引用

    // 注入抽象构建类型的对象
    public ComponentDecorator(Component component) {
        this.component = component;
    }

    @Override
    public void display() {
        component.display();
    }
}
